//---------------------------------------------------------------------------------
// Copyright (c) 2008 VoiceLynx Project
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
//     1. The origin of this software must not be misrepresented; you must not
//        claim that you wrote the original software. If you use this software
//        in a product, an acknowledgment in the product documentation would be
//        appreciated but is not required.
//
//     2. Altered source versions must be plainly marked as such, and must not be
//        misrepresented as being the original software.
//
//     3. This notice may not be removed or altered from any source
//        distribution.
//---------------------------------------------------------------------------------


#ifndef __UI_MainFrame__
#define __UI_MainFrame__

/**
@file
Subclass of UI_MainFrame, which is generated by wxFormBuilder.
*/

#include "UI_BaseClasses.h"
#include "VLUserSettings.h"

/** Implementing UI_MainFrame */
class UI_MainFrameExt : public UI_MainFrame
{
  DECLARE_EVENT_TABLE()

protected:
	// Handlers for UI_MainFrame events.
	void OnClose( wxCloseEvent& event );
	void OnEditProfiles( wxCommandEvent& event );
	void OnEditServers( wxCommandEvent& event );
	void OnTreeActivated( wxTreeEvent& event );
	void OnTreeContextMenu( wxTreeEvent& event );
	void OnMuteRx( wxCommandEvent& event );
	void OnMuteTx( wxCommandEvent& event );
	void OnConfigure( wxCommandEvent& event );
	void OnConnect( wxCommandEvent& event );
  //void OnUpdateUI( wxUpdateUIEvent& event );

  void OnTimerEvent(wxTimerEvent &event);
	
public:
	/** Constructor */
	UI_MainFrameExt( wxWindow* parent );

  void RefreshServers(bool isInit = false);
  void RefreshProfiles(bool isInit = false);

  void UpdateConnectUI();
  void UpdateChannelListUI();
  
  void Init();

  void SetTxIndicator(bool txAct, float txAmt)
  {
    //m_ledTxAct->
    m_ledTxVol->SetValue(txAmt);
  }

private:
  VLServerSettings  mServers;
  VLProfileSettings mProfiles;

  wxTimer           mUiUpdateTimer;

  bool              mDisconnectExpected;
  bool              mPreviousConnectionState;
};

#endif // __UI_MainFrame__
